var express = require('express');
var router = express.Router();

const {
  findNoticeList,
  insert,
  updateNotice,
  delById
} = require("../controller/notice");
const { authFilter } = require("../middlewares/auth");

class NoticeRouter {
  static initRouter() {
    router.get('/', authFilter, findNoticeList); // 获取所有的规则
    // router.get('/:id', authFilter, findById); // 获取单条规则
    router.put('/:id', authFilter, updateNotice); // 通过id修改规则
    router.post('/insert', authFilter, insert); // 添加公告
    router.delete('/:id', authFilter, delById); // 删除规则
    return router;
  }
}
module.exports = NoticeRouter.initRouter();